home *** CD-ROM | disk | FTP | other *** search
- Path: rcp6.elan.af.mil!rscernix!danpop
- From: danpop@mail.cern.ch (Dan Pop)
- Newsgroups: comp.os.msdos.programmer,comp.lang.c
- Subject: Re: open vs fopen?
- Date: 8 Feb 96 02:58:32 GMT
- Organization: CERN European Lab for Particle Physics
- Message-ID: <danpop.823748312@rscernix>
- References: <uEYFxc9nX8WX083yn@mbnet.mb.ca> <4f8bev$6tr@hermes.louisville.edu> <4fbfno$7f@noc.tor.hookup.net>
- NNTP-Posting-Host: hpl3sn04.cern.ch
- X-Newsreader: NN version 6.5.0 #7 (NOV)
-
- In <4fbfno$7f@noc.tor.hookup.net> Rajendra_Singh@msn.com (Rajendra Singh) writes:
-
- >gclind01@starbase.spd.louisville.edu (George C. Lindauer) wrote:
- >
- >>The only reason I know of is UNIX portability. Whenever I run across a
- >>unix program that uses the old-style open instead of fopen I usually
- >>end up rewriting it anyway though; I've had so many problems with
- >>the unix-style stuff I just rather would deal with the ANSI style.
- >
- >That's incorrect. fopen() is used for buffered I/O! open() is not a
- >UNIX specific function nor is it non-ANSI!
-
- That's incorrect. open() is a Unix-specific function (even if it was
- emulated on other systems) and it IS non-ANSI!
-
- BTW, in Unix both open() and fopen() are used for buffered I/O! fopen()
- adds an _additional_ level of buffering in order to minimize the number
- of read/write system calls. The kernel is doing its own buffering
- for read/write operations.
-
- Dan
- --
- Dan Pop
- CERN, CN Division
- Email: danpop@mail.cern.ch
- Mail: CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland
-